using System.Drawing;

namespace Lzfy_His_Service.Services
{
    public interface ICaptchaService
    {
        /// <summary>
        /// 生成验证码图片
        /// </summary>
        /// <param name="sessionId">会话ID</param>
        /// <returns>验证码图片的Base64字符串</returns>
        Task<string> GenerateCaptchaAsync(string sessionId);
        
        /// <summary>
        /// 生成验证码图片字节数组
        /// </summary>
        /// <param name="sessionId">会话ID</param>
        /// <returns>验证码图片的字节数组</returns>
        Task<byte[]> GenerateCaptchaImageBytesAsync(string sessionId);
        
        /// <summary>
        /// 验证验证码
        /// </summary>
        /// <param name="sessionId">会话ID</param>
        /// <param name="captcha">用户输入的验证码</param>
        /// <returns>验证是否成功</returns>
        Task<bool> ValidateCaptchaAsync(string sessionId, string captcha);
        
        /// <summary>
        /// 清除过期的验证码
        /// </summary>
        Task ClearExpiredCaptchasAsync();
    }
}